ostree-grub-generator: sort BLS files by version instead of alphabetically
authorJavier Martinez Canillas <javierm@redhat.com>
Wed, 27 Jun 2018 10:19:26 +0000 (12:19 +0200)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 27 Jun 2018 14:20:29 +0000 (14:20 +0000)
commit25e17e0b62e26a0ca82cd2a42d06ddd04274d475
treecb705e7d1466a7507e68185d5a1fde044a554b32
parent8dff04601b718869e67ac7f0ed8d535f89bedb58
ostree-grub-generator: sort BLS files by version instead of alphabetically

The ostree-grub-generator populates the grub.cfg menu entries using the
BLS config files. But it uses the ls command that by default sorts the
entries alphabetically, so the order won't be correct if there are more
than 10 deployments, i.e:

$ ls -1 /boot/loader/entries/
ostree-fedora-workstation-0.conf
ostree-fedora-workstation-10.conf
ostree-fedora-workstation-1.conf
...

So instead the -v option should be used to make ls use version sorting:

$ ls -1 -v /boot/loader/entries/
ostree-fedora-workstation-0.conf
ostree-fedora-workstation-1.conf
...
ostree-fedora-workstation-10.conf

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Closes: #1653
Approved by: cgwalters
src/boot/grub2/ostree-grub-generator